home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 1999 August / SGI Freeware 1999 August.iso / dist / fw_ORBit.idb / usr / freeware / doc / ORBit / IDEA1.z / IDEA1
Encoding:
Text File  |  1999-07-16  |  1.4 KB  |  47 lines

  1. <July 6> This feature will wait until we get a full-featured ORB that
  2. talks over the network. I don't think anyone (especially myself) has
  3. enough knowledge to implement it on the first go-round. -ECL
  4.  
  5. -----------------------------------------------------------------------
  6.  
  7. Fast way to avoid marshalling at all for calls to stuff in the same
  8. address space:
  9.  
  10. typedef struct CORBA_Object_struct *CORBA_Object;
  11. struct CORBA_Object_struct {
  12.     void (*release)(CORBA_Object _handle, CORBA_Environment &ev);
  13. };
  14.  
  15. #define CORBA_Object_release(_handle, evptr) _handle->release(_handle, evptr)
  16.  
  17. You would do this for all subclasses of an object, too:
  18.  
  19. typedef struct example_struct *example;
  20. struct example_struct {
  21.     void (*op1)(CORBA_Object _handle, int inparam, CORBA_Environment &ev);
  22. };
  23.  
  24. #define example_op1(_handle, inparam, evptr) \
  25.     _handle->release(_handle, inparam, evptr)
  26.  
  27. That is all.
  28.  
  29. -----------------
  30. Multiple inheritance makes this not-work.
  31.  
  32. However, we can still have our fun.
  33.  
  34. gulong CORBA_Object_class_id;
  35. typedef struct CORBA_Object_struct *CORBA_Object;
  36. struct CORBA_Object_struct {
  37.     gpointer *func_lookup_table;
  38. };
  39. typedef struct CORBA_Object_methods *CORBA_Object_methods
  40. struct CORBA_Object_methods {
  41.     void (*release)(CORBA_Object _handle, CORBA_Environment &ev);
  42. };
  43.  
  44.  
  45. #define CORBA_Object_release(_handle, evptr) \
  46. ((CORBA_Object_methods)_handle->func_lookup_table[CORBA_Object_class_id])->release(_handle, evptr)
  47.